<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>

  /* promise 源码*/
  function request1() {
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        //请求成功
      });
    })
  }

  function request2() {
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        //请求失败
      });
    })
  }
  function request3() {
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        //请求成功
      });
    })
  }
  // 利用promise all的方法统一管理请求 [res1,res2,res3]  [res1,null,res3]


</script>
</body>
</html>
